import React from 'react'
import Link from 'next/link';

export default async function Footer({ navigations, contact }) {

  return (
    <footer className="footer bg-black text-white">
      <div className='container grid grid-cols-1 md:grid-cols-3 gap-3 py-20 px-4 mx-auto'>
        <div className='col-span-1 w-full' >
          <ul className='flex h-full items-left justify-between flex-col w-full'>
            {
              navigations?.footer?.length > 0 && navigations?.footer?.map((item, index) => (
                <React.Fragment key={index}>{item.status === 0 && <li className='h-full flex items-left'>
                  <Link href={item.url} className='h-full flex items-left text-left justify-start py-1 text-white-600 hover:text-white-700 w-full'>{item.name}</Link>
                </li>}</React.Fragment>
              ))
            }
          </ul>
        </div>
        <div className='col-span-1'></div>
        <div className='col-span-1'>
          <ul className='flex flex-col'>
            {contact?.name && <li className='leading-6'>{contact?.name}</li>}
            {contact?.en_name && <li className='leading-6'>{contact?.en_name}</li>}
            {contact?.en_name && <li className='leading-6'><span>联系人：</span><span>{contact?.contact}</span></li>}
            {contact?.contact && <li className='leading-6'><span>固定电话：</span><span>{contact?.phone}</span></li>}
            {contact?.mobile && <li className='leading-6'><span>手机号码：</span><span>{contact?.mobile}</span></li>}
            {contact?.email && <li className='leading-6'><span>邮箱：</span><span>{contact?.email}</span></li>}
            {contact?.address && <li className='leading-6'><span>地址：</span><span>{contact?.address}</span></li>}

          </ul>
        </div>
      </div>
      <div className='flex justify-left items-center text-sm bg-black border-t border-gray-800 py-4 container mx-auto'>
        <span>@{new Date().getFullYear()}</span>
        <a href={contact?.website} className='mx-1 text-white-600 hover:text-white-700 flex items-center'>{contact?.website}</a>
        <span>版权所有</span>
        {contact?.icp && <span className='ml-2'>备案号：<a href="https://beian.miit.gov.cn/" className='text-white-600 hover:text-white-700'>{contact?.icp}</a></span>}
      </div>
    </footer>
  )
}
